<div class="layui-fluid" id="VIEW-list-table" lay-title="标签列表" lig-title="co-tag-title">
    <div class="layui-card">
        <div class="layui-card-header" lig-lang="label-searchTitle">筛选数据</div>
        <div class="layui-card-body">
            <form class="layui-form" lay-filter="lig-customer-tag-searchform">
                <div class="layui-row">
                    <div class="layui-inline">
                        <label class="layui-form-label" lig-lang="pd-customer">客户</label>
                        <div class="layui-inline">
                            <select name="customerCode">
                                <option value=""></option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label" lig-lang="tag-tagStatus">标签状态</label>
                        <div class="layui-inline">
                            <select name="tagStatus">
                                <option value=""></option>
                                <option value="1">初始化</option>
                                <option value="2">激活</option>
                                <option value="3">发放</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width:85px;" lig-lang="tag-cshsj">初始化时间</label>
                        <div class="layui-inline">
                            <input type="text" name="createdTimeQs" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-inline">--</div>
                        <div class="layui-inline">
                            <input type="text" name="createdTimeJs" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-row" style="margin-top:10px;">
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width:85px;" lig-lang="tag-tagProvideDate">发放时间</label>
                        <div class="layui-inline">
                            <input type="text" name="tagProvideDateQs" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-inline">--</div>
                        <div class="layui-inline">
                            <input type="text" name="tagProvideDateJs" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline" style="margin-left: 480px;">
                        <div class="layui-row layui-col-space10">
                            <div class="layui-col-xs6">
                                <div class="layui-btn layui-btn-sm layui-btn-fluid" lay-filter="lig-customer-tag-search" lig-lang="btn-search">查询</div>
                            </div>
                            <div class="layui-col-xs6">
                                <button type="reset" class="layui-btn layui-btn-sm layui-btn-primary" lig-lang="btn-reset">重置</button>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="layui-card">
        <div class="layui-card-body nepadmin-table-full">
            <table lay-filter="lig-customer-tag-table"></table>
        </div>
    </div>
</div>
<script type="text/html" id="tpl-tagStatus">
    {{#
    var tagStatus = {
    "1":{title:'初始化'},
    "2":{title:'激活'},
    "3":{title:'发放'},
    }[d.tagStatus];
    }}
    <span>{{ tagStatus.title }}</span>
</script>
<script>
    layui.use(['admin', 'table', 'form', 'dropdown', 'laytpl', 'laydate', 'jquery','lig'], function (admin, table, form, dropdown, laytpl, laydate, $, lig) {

        var _searchForm = '[lay-filter="lig-customer-tag-searchform"]';
        lig.selectCustomerList(_searchForm + '  select[name="customerCode"]');

        laydate.render({
            elem: _searchForm + ' input[name="tagProvideDateQs"]'
        });
        laydate.render({
            elem: _searchForm + ' input[name="tagProvideDateJs"]'
        });

        laydate.render({
            elem: _searchForm + ' input[name="createdTimeQs"]'
        });
        laydate.render({
            elem: _searchForm + ' input[name="createdTimeJs"]'
        });
        form.render();


        lig.table({
            elem: '[lay-filter="lig-customer-tag-table"]',
            url: 'pd/co/customer/tag/page',
            cols: [[
                { title: '<span lig-lang="pd-customerName">客户名称</span>', field: 'customerName', minWidth: 120 },
                { title: '<span lig-lang="tag-tagTid">标签标识号</span>', field: 'tagTid', minWidth: 120 },
                { title: '<span lig-lang="tag-tagStatus">标签状态</span>', field: 'tagStatus', minWidth: 120, templet: '#tpl-tagStatus' },
                { title: '<span lig-lang="tag-cshsj">初始化时间</span>', field: 'createdTime', minWidth: 120, templet: '<div>{{ layui.lig.toDateString(d.createdTime, "yyyy-MM-dd") }}</div>' },
                { title: '<span lig-lang="tag-tagProvideDate">发放时间</span>', field: 'tagProvideDate', minWidth: 120, templet: '<div>{{ layui.lig.toDateString(d.tagProvideDate || "", "yyyy-MM-dd") }}</div>'}

            ]]
        },{
            mode: 'dialog',
            entity: 'customer-tag',
            primaryField: 'tagTid'
        });


    })
</script>